package com.alone.embedded.lucene.annotation;

import com.alone.embedded.lucene.constant.FieldType;
import org.apache.lucene.index.IndexableField;

import java.lang.annotation.*;

/**
 * 字段类型注解
 *
 * @author Alone
 */
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target(ElementType.FIELD)
public @interface DocField {

    /**
     * 是否存储
     */
    boolean store() default true;

    /**
     * 字段类型
     */
    FieldType type() default FieldType.TEXT;

    /**
     * 扩展的字段
     *
     * @return Class[]
     * @see com.alone.embedded.lucene.constant.FieldFactory
     */
    Class<? extends IndexableField>[] extensionFields() default {};

}